package org.snia.cdmi.model;


public enum Permission {

	NULL("N/A"),
	
    Read("R"),

    Write("W"),

    ReadWrite("RW"),

    ReadWriteDelete("RWD");
    
    private String permissionString;
    
    private Permission(String permissionString) {
        this.permissionString = permissionString;
    }

    @Override
	public String toString() {
        return permissionString;
    }

    public static Permission fromValue(String str) {
        for (Permission permission : Permission.values()) {
            if (permission.permissionString.equals(str)) {
                return permission;
            }
        }    
        return null;
    }
    
}
